package com.OnTimeTeam.OnTime;


import android.app.Dialog;
import android.app.ProgressDialog;
import android.os.AsyncTask;


public class SyncWithWazeAddresses extends AsyncTask<String, Void, Boolean> {

    ProgressDialog progressDialog;
	private MainActivity host;
	private Dialog dialog;

	
	public SyncWithWazeAddresses(MainActivity host, Dialog dialog) {
		this.host = host;
		this.dialog = dialog;

	}
	
    protected Boolean doInBackground(String... params) {//In Background
    	
    	WazeHistoryParser.parseWazeAddresses(host);
    	
    	return true;
    }      

    protected void onPreExecute() {//Before
    	super.onPreExecute();

    	progressDialog = ProgressDialog.show(host, host.getResources().getString(R.string.synchronizing), host.getResources().getString(R.string.pleaseWait));
    }
    
    protected void onPostExecute(Boolean result) {//After

    	progressDialog.dismiss();
    	dialog.dismiss();
    	
    }
	
    protected void onProgressUpdate(Void... values) {
    	
    	
    }
}

